Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #38107 - Booted container images page #11269

Merged
merged 9 commits into from
Jan 22, 2025

Conversation

ianballou
Copy link
Member

What are the changes introduced in this pull request?

Adds the "Booted container images" page. In the future it'll likely change to be the "Containers" page and merge with the new container images UI.

Within the page, there is a table that shows an overview of booted container images used by bootc hosts. The table shows the image name, number of digests within, and the number of hosts using that container image:

image

The last functionality-TODO is to make the rows expand and show the actual digests within. I also need to write tests.

Considerations taken when implementing this change?

I decided to use the newer TableIndexPage from Foreman since it's the new goodness.

This PR is built on top of #11257.

What are the testing steps for this pull request?

  1. Create hosts that have bootc attributes, ideally enough to test the counting and pagination
  2. Try everything the new page has to offer, including the hyperlinks

@ianballou
Copy link
Member Author

It looks like I can't use the Foreman React Table component due to the expandable rows. That component sticks children inside a Tbody, but I need to create one Tbody elements for each expandable row.

Tbody elements cannot go inside another Tbody.

@ianballou ianballou marked this pull request as draft December 20, 2024 15:08
@ianballou ianballou force-pushed the 38107-bootc-images-page branch from ef686fc to d861aea Compare December 20, 2024 18:05
const BootedContainerImagesPage = () => {
const columns = {
image_name: {
title: __('Image name'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change this to Bootc - booted image name so it's also easier to figure out the serach query?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed all of the references to image_name to bootc_booted_image like in the API.

@sjha4
Copy link
Member

sjha4 commented Dec 20, 2024

So we don't forget after the break, the bookmarks controller needs some love on the page to work..

@ianballou ianballou force-pushed the 38107-bootc-images-page branch 3 times, most recently from 85536ed to 7ac103d Compare December 23, 2024 16:54
@ianballou
Copy link
Member Author

Sorting support is in!

@ianballou ianballou marked this pull request as ready for review January 6, 2025 16:34
@ianballou ianballou force-pushed the 38107-bootc-images-page branch 2 times, most recently from f634101 to 5c0f7d4 Compare January 10, 2025 21:49
Copy link
Member Author

@ianballou ianballou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed bookmarks and tidied up some things.
Empty state is still broken and I'm a little confused, and the table doesn't match the mock-up perfectly. Details below:

@ianballou ianballou force-pushed the 38107-bootc-images-page branch from 5c0f7d4 to 5af40f2 Compare January 10, 2025 21:54
@ianballou
Copy link
Member Author

Current state:
image

);
})}
</TableComposable>
{results.length > 0 && !errorMessage && bottomPagination}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More readable to not have bottomPagination and render the Pagination component directly here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

@ianballou ianballou force-pushed the 38107-bootc-images-page branch 2 times, most recently from 654bb12 to 9b2397c Compare January 15, 2025 20:09
@ianballou
Copy link
Member Author

I just pushed a fix for the rows all expanding at once.

@ianballou
Copy link
Member Author

Empty state is fixed, the nav capitalization is fixed, and I made some more testing progress.

@ianballou ianballou force-pushed the 38107-bootc-images-page branch 4 times, most recently from 81dfd4d to 68d69da Compare January 21, 2025 19:59
@sjha4
Copy link
Member

sjha4 commented Jan 21, 2025

Code looks good to me..Functionally it is working great..Pagination, bookmarking, searches, empty states etc work good on the page. I'll play some more and let @jeremylenz take a final look at the code in the meantime..

Screenshot from 2025-01-21 16-30-55
Single-record-alignment
Empty_state
Screenshot from 2025-01-21 16-32-04

Copy link
Member

@jeremylenz jeremylenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one, uh, query but code is looking good to me!

Copy link
Member

@sjha4 sjha4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am happy with this PR so I'll leave my ack..Feel free to merge when all the other discussions are resolved to @jeremylenz 's satisfaction. 😸

@sjha4
Copy link
Member

sjha4 commented Jan 22, 2025

I haven't tested on top of PF5 changes cause I was using a different environment for this one so be aware somethings may need to change when we switch to PF5.. @MariaAga 👀

hosts: {
title: __('Hosts'),
wrapper: ({ bootc_booted_image: bootcBootedImage, digests }) => (
<a href={`/hosts?search=bootc_booted_image%20=%20${bootcBootedImage}`}>{digests.reduce((total, digest) => total + digest.host_count, 0)}</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to respect the "New host overview page" Setting. Right now it always goes to the old hosts list page.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good catch, I remember seeing this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact I think I hit it during the community demo :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

Copy link
Member

@jeremylenz jeremylenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well now!

Thanks @ianballou

ACK 👍

@jeremylenz
Copy link
Member

err, I mean.. APGHA

looks like the tests need fixing now

@ianballou
Copy link
Member Author

Looks like using that setting broke the tests.

@ianballou ianballou force-pushed the 38107-bootc-images-page branch from 7edac87 to 749a5e0 Compare January 22, 2025 19:50
@jeremylenz
Copy link
Member

🍏

@ianballou ianballou merged commit 775218f into Katello:master Jan 22, 2025
18 of 19 checks passed
@ianballou ianballou deleted the 38107-bootc-images-page branch January 22, 2025 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants